package org.goyo.main.domain.entity.system;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.UniqueConstraint;

import org.hibernate.annotations.GenericGenerator;

/**
 * 角色表
 * @author chenchuan
 *
 */
@Entity
@Table(uniqueConstraints={@UniqueConstraint(columnNames={"role_num"})})
public class SysRole implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	@Id
	@GenericGenerator(name = "generator", strategy = "org.hibernate.id.UUIDGenerator")
	@GeneratedValue(generator = "generator")
	public String uuid;
	/**
	 * 角色编码
	 */
	@Column
	private String roleNum;
	/**
	 * 角色名称
	 */
	@Column
	private String roleName;
	/**
	 * 角色描述
	 */
	@Column
	private String remark;
	/**
	 * 角色类型
	 */
	@Column
	private String roleType;
	/**
	 * 状态
	 */
	@Column
	private String status;
	/**
	 * 用户
	 */
	@Transient
	private Set<SysUser> sysUsers;
	/**
	 * 资源
	 */
	@Transient
	private Set<SysResource> sysResources;
	
	/**
	 * 是否选中
	 */
	@Transient
	private boolean ischecked = false;
	
	/**
	 * resourceIds
	 */
	@Transient
	private String resourcesIds;
	
	public Set<SysResource> getSysResources() {
		return sysResources;
	}
	public void setSysResources(Set<SysResource> sysResources) {
		this.sysResources = sysResources;
	}
	public String getUuid() {
		return uuid;
	}
	public void setUuid(String uuid) {
		this.uuid = uuid;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getRoleType() {
		return roleType;
	}
	public void setRoleType(String roleType) {
		this.roleType = roleType;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public Set<SysUser> getSysUsers() {
		return sysUsers;
	}
	public void setSysUsers(Set<SysUser> sysUsers) {
		this.sysUsers = sysUsers;
	}
	public String getRoleNum() {
		return roleNum;
	}
	public void setRoleNum(String roleNum) {
		this.roleNum = roleNum;
	}
	public String getResourcesIds() {
		return resourcesIds;
	}
	public void setResourcesIds(String resourcesIds) {
		this.resourcesIds = resourcesIds;
	}
	public boolean isIschecked() {
		return ischecked;
	}
	public void setIschecked(boolean ischecked) {
		this.ischecked = ischecked;
	}
	
}
